/**
 * 
 */
package feeinterface.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;

import com.ulwx.database.DataBaseSet;
import com.ulwx.database.DbException;
import com.ulwx.database.RowMapper;
import com.ulwx.tool.DbUtils;

/**
 * 接口或类的说明:
 * 
 * 
 * @开发：huangjingfeng
 * @版本：1.0
 * @创建时间：2011-10-20
 */
public class BasePlatformDao {
	/**
	 * 
	 */
	private static final Logger log = Logger.getLogger(BasePlatformDao.class);

	/**
	 * 
	 * @param Platform
	 * @return
	 * @throws DbException
	 */
	public static String getPlatform(String Platform){
		String sql = "SELECT * FROM BasePlatform WHERE PlatformName=?";
		Map<Integer, Object> args = new HashMap<Integer, Object>();
		try {
			args.put(1, Platform);
			RowMapper<String> rowMapper = new RowMapper<String>() {
				public String mapRow(DataBaseSet rs) throws Exception {
					return rs.getString("BsPlatformTypeCode");
				}
			};
			List<String> list = DbUtils.doQueryObject(null, sql, args,
					rowMapper);
			if (list != null && list.size() > 0) {
				return list.get(0);
			}
		} catch (Exception e) {
			log.error("", e);
		}
		return "";
	}
}
